package org.footballmanager.pandafootball.system.service;

import org.footballmanager.pandafootball.system.domain.FootSociaty;
import org.footballmanager.pandafootball.system.domain.FootSociatyBfinfo;
import org.footballmanager.pandafootball.system.form.impl.FootSociatySearchForm;
import org.springframework.ui.Model;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;

public interface FootSociatyService extends BaseService<FootSociaty> {
	/**
	 * 创建战队
	 * @param userId
	 * @param name
	 * @return
	 */
	boolean createSociaty(Long userId, String name, HttpServletRequest request);
	
	/**
	 * 解散战队
	 * @param userId
	 */
	void deleteSociaty(Long userId, HttpServletRequest request);
	
	/**
	 * 根据用户主键找战队信息
	 * @param userId
	 * @return
	 */
	FootSociaty findFootSociatyByUserid(Long userId);
	
	/**
	 * 是否可以加入战队
	 * @param userId
	 * @param zhId
	 * @return
	 */
	boolean addSociaty(Long userId, Long zhId, HttpServletRequest request);
	
	/**
	 * 退出战队
	 * @param userId
	 * @param zhId
	 */
	boolean exitSociaty(Long userId, Long zhId, HttpServletRequest request);

	/**
	 * 开启或关闭战队状态
	 * @param status
	 */
	void changeStatus(boolean status, HttpServletRequest request);

    /**
     * 查询
     * @param entityname 实体类名
     * @param map 参数
     * @param footSociatySearchForm 条件
     */
    void search(String entityname, Model map, FootSociatySearchForm footSociatySearchForm);

    /**
     * 删除所有
     * @param footSociatySearchForm 条件
     * @param request 请求
     */
    void deleteAll(FootSociatySearchForm footSociatySearchForm, HttpServletRequest request);

    /**
     * 查询
     * @param footSociatySearchForm 条件
     * @return 列表
     */
    List<FootSociaty> findall(FootSociatySearchForm footSociatySearchForm);

    /**
     * 保存战队信息
     * @param footSociaty 战队实体类
     * @param img 上传文件
     * @param request 请求
     */
    void save(@Valid FootSociaty footSociaty, MultipartFile img, HttpServletRequest request);

    /**
     * 更新战队信息
     * @param footSociaty 战队实体类
     * @param img 上传文件
     * @param request 请求
     */
    void update(FootSociaty footSociaty, MultipartFile img, HttpServletRequest request);

    /**
     * 报分确认后更新数据
     * @param t 报分实体类
     * @param request 请求
     */
    void addEncourage(FootSociatyBfinfo t, HttpServletRequest request);

    /**
     * 删除报分后更新数据
     * @param t 报分实体类
     * @param request 请求
     */
    void deleteEncourage(FootSociatyBfinfo t, HttpServletRequest request);

    /**
     * 重新计算战队情况
     * @param zhufc
     * @param kefc
     * @param request 请求
     */
    void reComputeRank(FootSociaty zhufc, FootSociaty kefc, HttpServletRequest request);
}